package com.Shop.Center.service;

import com.Shop.Center.entity.Evaluate;
import com.Shop.Center.mapper.EvaluateMapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class EvaluateService {
    @Autowired
    EvaluateMapper evaluateMapper;
    public int add(long itemid,String content,long userid){
        Evaluate evaluate=new Evaluate();
        int id=new IdWorker().hashCode();
        evaluate.setContent(content);
        evaluate.setId(id);
        evaluate.setItemid(itemid);
        evaluate.setUserid(userid);
        return evaluateMapper.insert(evaluate);
    }
}
